#ifndef __C_TEXT_H_INCLUDE__
#define __C_TEXT_H_INCLUDE__

#include <cstring>


enum  eHorizontalAlign
{
	left,right,center,justify
};


class cText
{
private:
	const char* Text;
	int x; 
	int y; 

	const char* Font;
	int Size;
	int Width;
	int Height;
	eHorizontalAlign HorizontalAlign;
	const char* Color;

public:
	cText()
	{
		Init();
	}
	
	
	cText(const cText &in)
	{
		Init();  // base class initialization
		*this = in;
	}

	cText(const char* Text)
	{
		Init();  // base class initialization
		this->Text = Text;
	}
	
	void Init(void)
	{
		Width = -1;
		Height = -1;
		HorizontalAlign = left;
		Color= NULL;
	}


	~cText(void)
	{

	}

	void SetSize(int Size)
	{
		this->Size = Size;
	}

	int GetSize(void) const
	{
		return this->Size;
	}

	int GetX(void) const
	{
		return this->x;
	}
	
	void SetX(int X)
	{ 
		this->x = X;
	}

	int GetY(void) const { return this->y; }

	void SetY(int Y) { this->y = Y; }
	
	int GetWidth(void) const { return Width;}

	void SetWidth(int Width) { this->Width = Width; }
	
	bool WidthIsSetted(void) const { if (Width <0) {return false;} else {return true;}}

	int GetHeight(void) const { return Height;}

	void SetHeight(int Height) { this->Height = Height;	}

	bool HeightIsSetted(void) const { if (Height <0) {return false;} else {return true;}}

	const char* GetText(void) const { return this->Text; }

	void SetHorizontalAlign(eHorizontalAlign Align) { HorizontalAlign = Align;}

	eHorizontalAlign GetHorizontalAlign(void) const {return HorizontalAlign; }

	void SetColor(const char* Color) { this->Color = Color;}
	
	const char* GetColor(void) const{ return this->Color;}

	float MeasureTextWidth(void) const
	{
		if( Width < 0)
			return strlen(Text) * Size;
		else
			return Width;
	}

	float MeasureTextHeight(void) const
	{
		if( Height < 0)
			return Size;
		else
			return Height;
	}
};

#endif 